package com.driver.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @description 用户类型枚举类，对应user表中的type字段
 */
public enum UserType implements IEnum<Integer> {

    SUPER_ADMIN(0, "超级管理员"),

    ADMIN(1, "管理员"),

    USER(2, "普通用户");

    @JsonValue
    private final Integer code;

    private final String message;

    UserType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public Integer getValue() {
        return code;
    }
}
